﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Titan.WcfTest.Web.Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title> 
    <script type="text/javascript" src="js/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="js/serviceProxy.js"></script> 
</head>
<body>
    <form id="Form1" runat="server">
    <input type="button" id="btn" value="dowork" />
    <input type="button" id="btn2" value="getparameter" />
    <input type="button" id="btn3" value="getDynamicEntity" />

    <script language="javascript">
        $(function () {
            $("#btn").bind("click", null, function () {

                var CustomerProxy = new ServiceProxy("/Service2.svc/");
                CustomerProxy.invoke("DoWork", { name: "henry", age: 5 },
                    function (data) {
                        alert(data.Age);
                    },
                 null, null, true);

            });
            $("#btn2").bind("click", null, function () {

                var CustomerProxy = new ServiceProxy("/Service2.svc/");
                CustomerProxy.invoke("GetQueryParameter", { name: "henry", age: 5 },
                    function (data) {
                        alert("A" + data.PageIndex);
                    },
                 null, null, true);
            });
            $("#btn3").bind("click", null, function () {

                var CustomerProxy = new ServiceProxy("/Service2.svc/");
                CustomerProxy.invoke("GetDynamicEntity", { name: "henry", age: 5 },
                    function (data) {
                        alert("GetDynamicEntity:" + data);
                    },
                 null, null, true);
            });
        });
    </script>
    </form>
</body>
</html>
